package com.tedu.bill;

/**
 * Author：毕龙
 * Date: 2024/4/10 19:23
 * 封装就是将属性私有  提供公开的get/sex方法
 * 保护数据的安全
 */
public class CreditCard {
    private int no;
    private String pass;

    public void setNo(int no){
        this.no = no;
    }
    public int getNo(){
        return no;
    }

    public void setPass(String pass){
        if(this.pass == null){
            this.pass = "000000";
        }
        if(pass.length() == 6){
            this.pass = pass;
        }else{
            System.out.println("修改密码失败");
        }

    }

    public String getPass(){
        return pass;
    }

}
